package com.irun.sm.ui.demo.utils;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/***
 * @author huangsm
 * @date 2013-1-25
 * @email huangsanm@gmail.com
 * @desc 全局adpater
 */
public class GlobalsAdapter extends BaseAdapter {

	private Context mContext;
	private View mConvertView;
	private List mData;
	
	/**
	 * 构造函数
	 * @param context
	 * @param convertView getView中的convertView
	 * @param dataSource 数据源
	 */
	public GlobalsAdapter(Context context, View convertView, List dataSource){
		mContext = context;
		convertView = convertView;
		mData = dataSource;
	}
	
	@Override
	public int getCount() {
		return mData.size();
	}

	@Override
	public Object getItem(int position) {
		return mData.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null){
			convertView = mConvertView;
			//TODO:
		} else {
			
		}
		return convertView;
	}
	
}
